{extend name='common/_container'}
{block name="content"}
<div class="ibox float-e-margins">
<input type="hidden" name='id' id='id' value="{$info.id}" />
	<div class="ibox-content">
		<div class="form-horizontal" id="CodeInfoForm">
			<div class="row">
				<div class="col-sm-12">
				<!-- form start -->
					<div class="form-group introducer">
						<label class="col-sm-2 control-label">银行代码：</label>
						<div class="col-sm-9">
							<input type="text" id="aba_code" value="{$info.aba_code}" name="name" class="form-control" placeholder="请输入银行代码">
						</div>
					</div>
					<div class="form-group introducer_mobile">
						<label class="col-sm-2 control-label">银行名称：</label>
						<div class="col-sm-9">
							<input type="text" id="bank_name" value="{$info.bank_name}" name="bank_name" class="form-control" placeholder="请输入银行名称">
						</div>
					</div>
					<div class="form-group introducer_mobile">
						<label class="col-sm-2 control-label">分行地址：</label>
						<div class="col-sm-9">
							<input type="text" id="branch_bank" value="{$info.branch_bank}" name="branch_bank" class="form-control" placeholder="请输入分行">
						</div>
					</div>
					<div class="form-group introducer_mobile">
						<label class="col-sm-2 control-label">账号：</label>
						<div class="col-sm-9">
							<input type="text" id="bank_no" value="{$info.bank_no}" name="bank_no" class="form-control" placeholder="请输入账号">
						</div>
					</div>
				</div>
				<!-- form end -->
				</div>
			</div>
			<div class="hr-line-dashed"></div>
			<div class="row btn-group-m-t">
				<div class="col-sm-9 col-sm-offset-1">
					<button type="button" class="btn btn-primary" onclick="{if condition="$info.id neq ''"}CodeInfoDlg.update(){else/}CodeInfoDlg.add(){/if}" id="ensure">
						<i class="fa fa-check"></i>&nbsp;确认提交
					</button>
					<button type="button" class="btn btn-danger" onclick="CodeInfoDlg.close()" id="cancel">
						<i class="fa fa-eraser"></i>&nbsp;取消
					</button>
				</div>
			</div>
		</div>
	</div>
</div>
<script src="__PUBLIC__/static/js/admin/Bank.js?t=<?php echo rand(1000,9999)?>" charset="utf-8"></script>
<script src="__PUBLIC__/static/js/upload.js" charset="utf-8"></script>
<script src="__PUBLIC__/static/js/plugins/layui/layui.js?t=1498856285724" charset="utf-8"></script>
<script>
layui.config({dir: '__PUBLIC__/static/js/plugins/layui/'});
	layui.use(['layer', 'form'], function () {
	window.layer = layui.layer;
	window.form = layui.form();
});
layui.use('element', function(){
	var element = layui.element();
	element.on('tab(test)', function(elem){
	});
});



$("#name").blur(function(){
	var name =$.trim($(this).val());
	var html='<small class="help-block" id="is_exist" style="display: none;">该介绍人已经存在</small>';
	$(this).parent().append(html);
	if(name!=''){
		$.post("{:url('admin/Record.Introducer/checkName')}",{name:name},function(result){
			if(result.status!='00'){
				$("#is_exist").show();
				$("#name").next().removeClass('glyphicon-ok').addClass('glyphicon-remove');
				$("#name").parent().parent().removeClass('has-success').addClass('has-error');
			}
		});
	}
});

$("#name").keyup(function(){
	var flag=false;
	$(this).nextAll('small').not('#is_exist').each(function(){
		if($(this).is(':visible')){
			flag=true;
		}
	})
	if(flag){
		$("#is_exist").hide();
	}
});
</script>


{/block}
